package com.haier.cloudremote.common;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;

public class RemoteManager {
	public static String filename = "ssc";
	
	/**
	 * 设置配置文件中的学习状态
	 * @param context
	 * @param isFinished
	 */
	public static void setStudyState(Context context, boolean isFinished){
		// 写配置文件
		Editor sharedata = context.getSharedPreferences(filename, Context.MODE_PRIVATE)
				.edit();
		sharedata.putBoolean("finishStudy", isFinished);
		
		sharedata.commit();
	}
	
	/**
	 * 获取学习状态
	 * @param context
	 * @return 是否学习完成
	 * 	true：已经结束学习
	 * 	false:未完成学习
	 */
	public static boolean getStudyState(Context context){
		SharedPreferences sharedata = context.getSharedPreferences(filename,
				Context.MODE_PRIVATE);
		return sharedata.getBoolean("finishStudy", false);
	}
}
